<template>
	<!-- 新手指南 -->
	<view class="noviceguide_wp">
		<view class="n_list" v-for="item in list" :key="item.id">
			<view class="n_title">{{item.name}}</view>
			<view class="n_items" v-for="iitem in item.list" :key="iitem.id" @click="$navTo(iitem.url)">
				<view class="n_item">
					<text>{{iitem.title}}</text>
					<text class="yticon icon-you"></text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			this.getlist();
		},
		methods:{
			toUrl(item){
				console.log(item)
				if(item.url&&item.url.includes('http')){
					item.url = escape(item.url);
					uni.navigateTo({
						url: "/pages/web/web-view?url=" + item.url
					})
				}else{
					uni.navigateTo({
						url: '/pages/userservice/questiondetails?id='+item.id
					})
				}
			},
			getlist(){
				this.$axios('index/helpMember','POST','salemsg').then(res=>{
					if(res.data.code==200){
						this.list=res.data.data.category;
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f2f2f2;
		color: $font-color-dark;
		padding-bottom: 130upx;
	}

	.n_list {
		background-color: #fff;
		margin-bottom: 20upx;
		padding: 0 20upx 20upx;
		overflow: hidden;
	}

	.n_title {
		margin: 30upx 0 10upx;
		font-weight: bold;
		letter-spacing: 2px;
		padding-left: 20upx;
		position: relative;
	}

	.n_title:after {
		content: '';
		position: absolute;
		left: 0;
		top: 50%;
		transform: translateY(-50%);
		border-left: 4px $base-color solid;
		height: 94%;
	}

	.n_items {
		color: $font-color-base;
	}

	.n_item {
		border-bottom: 1px hsl(0, 0%, 87%) solid;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 30upx 0;
	}

	.yticon {
		color: #000;
	}
</style>
